<div class="results index">

<?php
//	print_r($u1);
//    echo '<strong><br>There are '.count($uf).' influential users<br></strong>';
//    print_r($ufed);
//    echo '<strong><br>There are '.count($ufed).' influenced users<br></strong>';
//    echo 'The result: the order of users: ';
//    print_r($r);
?>
	<h2><?php __('The minimum list of influential users maximizes the influence spread');?></h2>
 <?php
   // echo '<strong>'.count($r_highest).' nodes with BASELINE</strong><br>';
	 //print_r($r_highest);
?>
  <br /> <?php
     //echo '<strong>'.count($r).' nodes (optimized with Designed Algorithm)</strong><br>';
	 //print_r($r);
?>
	<table cellpadding="0" cellspacing="0">
	<tr>
            <th>No.</th>
			<th><?php echo 'User';?></th>
			<th><?php echo 'Influenced user';?></th>
            <th><?php echo 'Algorithm';?></th>
	</tr>
	<?php
	$dem1 = 0;
    $n=count($opts1);
	for ($i=0;$i<$n;$i++){
		$class = null;
		if ($i % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
	    <td><?php echo $i+1; ?></td>
		<td><?php 
                if($i==0){
                    $dem1++;
                    echo '<p style="color:#E04242;"><strong>'.$opts1[$i]['Opt']['u1'].'</strong></p>';
                }
                else{
                    if($opts1[$i-1]['Opt']['u1']!=$opts1[$i]['Opt']['u1']){
                        echo '<p style="color:#E04242;"><strong>'.$opts1[$i]['Opt']['u1'].'</strong></p>';
                        $dem1++;
                    }
                } 
            ?>&nbsp;</td>
		<td><?php echo $opts1[$i]['Opt']['u2']; ?>&nbsp;</td>
	</tr>
<?php } ?>
	</table>
     <?php
	 echo $dem1.' influential users';
?>
    <br />
    	<table cellpadding="0" cellspacing="0">
	<tr>
            <th>No.</th>
			<th><?php echo 'User';?></th>
			<th><?php echo 'Influenced user';?></th>
          
	</tr>
	<?php
	$dem = 0;
    $n=count($opts2);
	for ($i=0;$i<$n;$i++){
		$class = null;
		if ($i % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
	    <td><?php echo $i+1; ?></td>
		<td><?php 
                if($i==0){
                    $dem++;
                    echo '<p style="color:#E04242;"><strong>'.$opts2[$i]['Opt']['u1'].'</strong></p>';
                }
                else{
                    if($opts2[$i-1]['Opt']['u1']!=$opts2[$i]['Opt']['u1']){
                        echo '<p style="color:#E04242;"><strong>'.$opts2[$i]['Opt']['u1'].'</strong></p>';
                        $dem++;
                    }
                    
                } 
            ?>&nbsp;</td>
		<td><?php echo $opts2[$i]['Opt']['u2']; ?>&nbsp;</td>
	</tr>
<?php } ?>
	</table>
   <?php
	 echo $dem.' influential users';
?>
	</div>

<div class="actions">
	<h3><?php __('Actions'); ?></h3>
	<ul>

		<li><?php echo $this->Html->link(__('Do another experiment', true), array('controller'=>'exps','action' => 'testl'));?></li>
        <li><?php echo $this->Html->link(__('Back', true), array('controller'=>'exps','action' => 'r1',$idtest));?></li>
        <li><?php echo $this->Html->link(__('Chart', true), array('controller'=>'expmaxs','action' => 'chart',$idtest));?></li>
	
	</ul>
</div>